<p><b>Link To A Module</b></p>

<p>How to open another module from your modules toolbar.</p>

<p>In a green font below is code showing how I added a toolbar button to the Grid window
that when clicked, opens the Tab Window.</p>

<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Code: DesktopConfig.js</div>
<pre>
MyDesktop.GridWindow = Ext.extend(Ext.app.Module, {
	
	appType : 'grid',
	id : 'grid-win',
    
	init : function(){
		this.launcher = {
			text: 'Grid Window',
			iconCls:'icon-grid',
			handler : this.createWindow,
			scope: this
		}
	},

	createWindow : function(){
		var desktop = this.app.getDesktop();
		var win = desktop.getWindow('grid-win');
        
		if(!win){
			<font color="Green">var tabWinLauncher = MyDesktop.getModule('tab-win').launcher;</font>
			
			win = desktop.createWindow({
				id: 'grid-win',
				title:'Grid Window',
				width:740,
				height:480,
				iconCls: 'icon-grid',
				shim:false,
				animCollapse:false,
				constrainHeader:true,
				layout: 'fit',
				items: new Ext.grid.GridPanel({
					border:false,
					ds: new Ext.data.Store({
						reader: new Ext.data.ArrayReader({}, [
							{name: 'company'},
							{name: 'price', type: 'float'},
							{name: 'change', type: 'float'},
							{name: 'pctChange', type: 'float'}
						]),
						data: Ext.grid.dummyData
					}),
					cm: new Ext.grid.ColumnModel([
						new Ext.grid.RowNumberer(),
						{header: "Company", width: 120, sortable: true, dataIndex: 'company'},
						{header: "Price", width: 70, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
						{header: "Change", width: 70, sortable: true, dataIndex: 'change'},
						{header: "% Change", width: 70, sortable: true, dataIndex: 'pctChange'}
					]),
					shadow: false,
					shadowOffset: 0,
					viewConfig: {
						forceFit:true
					},
					//autoExpandColumn:'company',
	
					tbar: [{
						text:'Add Something',
						tooltip:'Add a new row',
						iconCls:'add'
					}, '-', {
						text:'Options',
						tooltip:'Blah blah blah blah',
						iconCls:'option'
					},'-',{
						text:'Remove Something',
						tooltip:'Remove the selected item',
						iconCls:'remove'
					},'-',<font color="Green">{
						text: 'Open Tab Window',
						handler: tabWinLauncher.handler,
						scope: tabWinLauncher.scope,
						iconCls: tabWinLauncher.iconCls
					}</font>]
				})
			});
		}
		win.show();
	}
});
</pre>
</div>